import request from '@/utils/request'

// 定义公共的api
const BASE_URL = '/admin/system/movie'

export default {
  getMoviePageInfo(page, limit, searchObj) {
    return request({
      url: `${BASE_URL}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  getMovieById(id) {
    return request({
      url: `${BASE_URL}/findMovieById/${id}`,
      method: 'get'
    })
  },
  addMovie(data) {
    return request({
      url: `${BASE_URL}/addMovie`,
      method: 'post',
      data
    })
  },
  updateMovie(data) {
    return request({
      url: `${BASE_URL}/updateMovie`,
      method: 'post',
      data
    })
  },
  removeMovieById(id) {
    return request({
      url: `${BASE_URL}/removeMovie/${id}`,
      method: 'delete'
    })
  },
  // 批量删除
  removeMovieByIds(ids) {
    return request({
      url: `${BASE_URL}/removeMovieByIds`,
      method: 'delete',
      data: ids
    })
  },
  // 根据id获取palyAuth播放凭证
  getPlayAuthById(id) {
    return request({
      url: `${BASE_URL}/getPlayAuth/${id}`,
      method: 'get'
    })
  }
}
